# assignment operator

<#
$a = 10
$a
$a= "this is a string"
$a
#>


#self increment operator

<#
$str="helloPowerShell"
for($i=0;$i -lt $str.Length;$i+=2)
{
    $str[$i]
}
#>

#self decrement operator
# $str="thisIsMyPowerShell"
# test by myself : $str.length-1 can also be written as ($str.length-1)
# for($i=$str.Length-1;$i -ge 0;$i-=2)
<#
for($i=($str.Length-1);$i -ge 0;$i-=2)
{
    $str[$i]
}
#>

# factorial of 10 using self computation operator

<#
$str=1
for($i=1;$i -le 10;$i++)
{
    $str *=$i
}

write-host "factorial of 10 is $str"
#>


# division of 100 by 1 to 10 using self computation operator

<#
$total=100
for($i=1;$i -le 10;$i++)
{
    $total /=$i
}
#>

# print all the characters of a string using self computation operator
<#
$str="abcdefghijklmnopqrstuvwxyz"
for ($i = 0; $i -lt $str.Length; $i++) {
    # Action that will repeat until the condition is met 
    $str[$i]
}
#>

# print all the characters of a string in reverse order using self computation operator
<#
$str="abcdefghijklmnopqrstuvwxyz"
for ($i = $str.Length - 1; $i -ge 0; $i--) {
    # Action that will repeat until the condition is met 
    write-host $str[$i]
}
#>



